<%= stylesheet('bootstrap','style','group')%>
<div id="main">
<div  class="container">

	<%= render 'public/flash_notice' %>

	<div class="comm-left">
		<div class="group-info cc">
			<div class="group-logo">
				<% if !@group.ico.nil? %>
					<%= link_to (image_tag @group.ico.url('100x100'), :alt => @group.name), @group %>
				<% else %>
					<%= link_to (image_tag 'g.jpg', :alt => @group.name), @group %>  
				<% end -%>
				
			</div>
			<div class="group-detail">
				<h4><%= @group.name%></h4><cite>（<%= @group.member_num + 1 %> 个成员）</cite>
				<p><%= truncate(@group.descrip,:length =>60, :truncate_string =>"...")%></p>

				<% if @gu %>
					<div class="group-btns">
						<%= link_to '发表话题', new_group_topic_path(@group), class: 'btn btn-success' %>

						<%= link_to '退出小组', leave_group_path(@group), class: 'btn' %>
					</div>
			
					<% if @gu.level == 2 %>
						<%= link_to '审核管理员', applyers_group_path(@group) %>
						|
						<%= link_to '编辑小组', edit_group_path(@group)%>
					<% end -%>
			<% else %>
				<%= link_to '加入小组', join_group_path(@group), class: 'btn btn-success group-join'%>
				<span>加入之后，你可以在这个小组发布分享和话题</span>
			<% end %>
			</div>

			
		</div>
		
		<%= render :partial => 'public/topics',:locals  => {:topics  => @topics, :is_topics => true} %>
		
	</div>
	<div class="comm-right">
		<div class="fixed">
		<div class="group-members">

			<h4>小组管理员</h4>
			<div class="content cc">
				<ul>
					<% if !@creater.nil? %> 
					<li>
						
							<%if @creater.icon.exists? %>
						        <%= link_to (image_tag @creater.icon.url(:thumb) ,:alt => @creater.nickname), @creater %>
						    <%else%>
						        <%= link_to (image_tag 'avatar.jpg' ,:alt => @creater.nickname), @creater %>
						    <%end%>
							<p><%= @creater.nickname %></p>
						
					</li>
					<% end%>
				
						<% @managers.size > 0 && @managers.each do |manager| %>
						<li>
							<% if manager.icon.exists? %>
								<%= link_to (image_tag manager.icon.url(:thumb),:alt => manager.nickname, :title => manager.nickname), manager %>
							<% else %>
								<%= link_to (image_tag 'avatar.jpg' ,:alt => manager.nickname), manager %>
							<% end -%>
							
							<p><%= manager.nickname %></p>
						</li>
						<% end -%>
					
					
				
					<% if @gu.nil?  || (@gu.level == 0 && (@gu.status == 0 || @gu.status == 3)) %>
			
						<li>
						<%= link_to image_tag('avatar.jpg',:alt => '申请管理员' ,:title => '申请管理员'),apply_group_path(@group)%>
						<p>申请管理员</p></li>
					<% end -%>
					
					
				</ul>
			</div>
		</div>
        
		<div class="group-members">
			<h4>最新加入</h4>
			<div class="content cc">
				<ul>
					<% if @members != nil %>
						<% @members.each do |member| %>
							<li>
								<% if !member.avatar.nil? %>

									<%= link_to (image_tag member.avatar.url('100x100'),:alt => member.nickname ,:title => member.nickname), member %>
								<% else %>
									<%= link_to (image_tag 'avatar.jpg' ,:alt => member.nickname), member %>

								<% end -%>

								<p><%= member.nickname %></p>
							</li>
						<% end %>
					<% end -%>
				</ul>
			</div>
		</div>

		
		</div>
		</div>
	</div>
</div>
</div>